<!--{*Part of the CEFIRO project by dyrtech.com.ve. Copyleft GPLv3 2007. Please see the disclaimer at the root of the project: http://dyrtech.com.ve/cefiro/license.txt*}-->
{if $sb_head == "true"}
	<link type="text/css" rel="stylesheet" href="{$searchboxcss}">
  <script type="text/javascript" src="{$sb_js}"></script>
{else}
  {if $smartyVar != ''}
  <script type="text/javascript">
  {/if}
    {foreach from=$mOpts item=aOpt}
     	options_{$aOpt.name} = {literal}{{/literal}
    	  script:"{$sb_path}?backend_script={$aOpt.backend_script}&backend_fcn={$aOpt.backend_fcn}&",
    		varname:"backend_var",
    		{if $aOpt.noresults != ""}noresults:"{$aOpt.noresults}",{else}shownoresults:false,{/if}
    		{if $aOpt.callback != ""}callback: function (obj) {literal}{{/literal} {$aOpt.callback} {literal}}{/literal},{/if}
    		{if $aOpt.minchars != ""}minchars:{$aOpt.minchars},{/if}
    		{if $aOpt.delay != ""}delay:{$aOpt.delay},{/if}
    		{if $aOpt.timeout != ""}timeout:{$aOpt.timeout},{/if}
    		{if $aOpt.cache != ""}cache:{$aOpt.cache}{/if}
    	{literal}};{/literal}
    	as_{$aOpt.name} = new AutoSuggest('{$aOpt.name}', options_{$aOpt.name});
    {/foreach}
  {if $smartyVar != ''}
  </script>
  {/if}
{/if}